package com.bw.liveplay.common.mvvm.adapter

import android.widget.ImageView
import android.widget.TextView
import com.bw.liveplay.R
import com.bw.liveplay.common.entity.RecommentEntity
import com.bw.liveplay.common.entity.RemDataEntity
import com.bw.liveplay.common.network.LoadImage
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @author KK
 * @description:
 * @date :2021/11/12 10:30
 *
 */
class RecommentAdapter : BaseQuickAdapter<RemDataEntity, BaseViewHolder>(R.layout.item_recomment) {
    init {
        addChildClickViewIds(R.id.item_recomment_gz)
    }
    override fun convert(holder: BaseViewHolder, item: RemDataEntity) {
        var img = holder.getView<ImageView>(R.id.item_recomment_img)
        var text = holder.getView<TextView>(R.id.item_recomment_text)
        var count = holder.getView<TextView>(R.id.item_recomment_count)
        var icon = item.icon
        if (icon != null) {
            LoadImage.loadcrile(icon,img)//设置头像
        }
        text.setText(item.title)
        count.setText(""+item.feedNum)


    }
}